package com.yyk.yykywd.test.example

import android.widget.ImageView
import kotlin.reflect.full.*    // required import

/**
 * 文件描述：
 * Created by guo on 2019-12-13.
 */
@ImAPlant
class Plant {
    @get:onGet
    val isGrowing: Boolean = true

    @set:onSet
    var needsFood: Boolean = false
}

fun testAnnotations() {
    val classObj = Plant::class
    val myAnnotationObject = classObj.findAnnotation<ImAPlant>()
    println(myAnnotationObject)
}

fun main() {

    val list = listOf("1", "2", "3")
    val joinToString = list.joinToString(limit = 2) { it }
    println(joinToString)
}

annotation class ImAPlant

@Target(AnnotationTarget.PROPERTY_GETTER)
annotation class onGet

@Target(AnnotationTarget.PROPERTY_SETTER)
annotation class onSet



